package yz.dut.edu.graduate.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yz.dut.edu.graduate.bean.Result;
import yz.dut.edu.graduate.service.ComprehensiveService3;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/cook")
public class DishCookController {
    @Autowired
    ComprehensiveService3 comprehensiveService3;

    @PostMapping("/updateState")
    public Result UpdateState(HttpServletRequest request){
        long h_id=Long.parseLong(request.getParameter("hId"));
        return comprehensiveService3.UpdateState(h_id);
    }

    @GetMapping("/getData")
    public Result GetData(){
        return comprehensiveService3.GetData();
    }
}
